﻿using System;
using System.Windows.Automation;

namespace QuickUIT.Controls
{
    /// <summary>
    /// Represents a toolbar control. 
    /// </summary>
    public class UIToolBar : UIBaseControl
    {
        /// <summary>
        /// Gets the dock position for the control. 
        /// If the control does not support the <see cref="DockPattern"/>, returns a null reference.  
        /// </summary>
        public new DockPosition? DockPosition
        {
            get { return base.DockPosition; }
        }

        /// <summary>
        /// Gets the current expand collapse state of the control.
        /// If the control does not support the <see cref="ExpandCollapsePattern"/> , returns a null reference.
        /// </summary>
        public new ExpandCollapseState? ExpandCollapseState
        {
            get { return base.ExpandCollapseState; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be moved. 
        /// </summary>
        public new bool CanMove
        {
            get { return base.CanMove; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be resized. 
        /// </summary>
        public new bool CanResize
        {
            get { return base.CanResize; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be rotated. 
        /// </summary>
        public new bool CanRotate
        {
            get { return base.CanRotate; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIToolBar"/> class. 
        /// </summary>
        public UIToolBar()
            : base(ControlType.ToolBar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIToolBar"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        public UIToolBar(UIBaseControl parent)
            : base(parent, ControlType.ToolBar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIToolBar"/> class.
        /// </summary>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIToolBar(string locator)
            : base(null, ControlType.ToolBar, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIToolBar"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIToolBar(UIBaseControl parent, string locator)
            : base(parent, ControlType.ToolBar, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIToolBar"/> class.
        /// </summary>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UIToolBar(AutomationElement control) : base(control, ControlType.ToolBar)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIToolBar"/> class.
        /// </summary>
        /// <param name="parent">The parent of the control</param>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UIToolBar(UIBaseControl parent, AutomationElement control) : base(parent, control, ControlType.ToolBar)
        {
        }

        /// <summary>
        /// Sets the current dock position of the toolbar.
        /// </summary>
        /// <param name="dockPosition">The new dock position.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The current element does not exist anymore.</exception>
        public new void Dock(DockPosition dockPosition)
        {
            base.Dock(dockPosition);
        }

        /// <summary>
        /// Expands the toolbar, displaying all its child nodes, controls or content. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The current element does not exist anymore.</exception>
        public new void Expand()
        {
            base.Expand();
        }

        /// <summary>
        /// Collapses the toolbar, hiding all its child nodes, controls or content. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The current element does not exist anymore.</exception>
        public new void Collapse()
        {
            base.Collapse();
        }

        /// <summary>
        /// Moves the toolbar.
        /// </summary>
        /// <param name="x">The absolute screen coordinates of the left side of the control.</param>
        /// <param name="y">The absolute screen coordinates of the top of the control.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The current element does not exist anymore.</exception>
        public new void Move(double x, double y)
        {
            base.Move(x, y);
        }

        /// <summary>
        /// Resizes the toolbar. 
        /// </summary>
        /// <param name="width">The new width of the window, in pixels.</param>
        /// <param name="height">The new height of the window, in pixels.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The current element does not exist anymore.</exception>
        public new void Resize(double width, double height)
        {
            base.Resize(width, height);
        }

        /// <summary>
        /// Rotates the toolbar. 
        /// </summary>
        /// <param name="degrees">The number of degrees to rotate the control. A positive number rotates clockwise; a negative number rotates counterclockwise.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The current element does not exist anymore.</exception>
        public new void Rotate(double degrees)
        {
            base.Rotate(degrees);
        }
    }
}
